home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6570 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: gail.ripco.com!mambuhl
  2. From: mambuhl@ripco.com (Martin Ambuhl)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Can someone tell me w
  5. Date: 19 Feb 1996 18:53:54 GMT
  6. Organization: Ripco Communications, Inc.
  7. Message-ID: <4gah02$6ci@gail.ripco.com>
  8. NNTP-Posting-Host: foley.ripco.com
  9.  
  10. atk@mathcs.emory.edu (Alan Krantz)
  11. in <4g27n5$qa4@solutions.solon.com> asks:
  12.  
  13.  
  14. >I know the following is illegal but I would really really like to know
  15. >why C can't support the following construct:
  16.  
  17. >typedef struct _mytbl {
  18. >  char  *str;                  ; Leagal
  19. >  int   *data;                 ; Illegal (see below)
  20. >} mytbl[] = {"Not Defined", {0},
  21. >                         "Square",      {1,2,3,4,0},
  22. >                         "Circle",      {1,2,0},
  23. >}
  24.  
  25. Among other things, because you are attempting to declare mytbl[] as the
  26. name of a type or to use typedef to define an object mytbl. `typedef'
  27. statements are not used to declare objects.
  28.                                                                                                                          
  29. --
  30. * Martin Ambuhl       net: mambuhl@ripco.com
  31. * Chicago, IL (USA)    
  32.